<template>
	
	<view>
		<view style="display: flex;margin-top: 20rpx;">
			<input placeholder="请输入搜索内容" style="width: 600rpx;text-align: center;margin-left: 40rpx;border-radius: 40rpx;border: #D4D5D7 4rpx solid;height: 60rpx;" v-model="Searchtext"/>
			<view style="margin-top: 10rpx;margin-left: 10rpx;">搜索</view>
		</view>
		<view style="display: flex;margin-top: 40rpx;border-bottom: 4rpx solid #D4D5D7; width: 710rpx;margin-left: 20rpx;" v-for="(item,index) in partnerdata" :key='index'>
			<view style="margin-left: 40rpx;margin-top: 20rpx;width: 180rpx;" v-model="username">{{item.name}}</view>
			<view style="margin-left: 20rpx;margin-top: 20rpx;width: 260rpx;" v-model="phone">{{item.phone}}</view>
			<view style="margin-left: 20rpx;margin-top: 20rpx;width: 100rpx;" v-model="phone">{{item.self_p}}%</view>
			<button style="width: 160rpx;height: 80rpx;font-size: 30rpx;padding: 0rpx;border: 0rpx;border-radius: 20rpx;background-color: limegreen;color: white;margin-bottom: 20rpx;" @tap="goupdata(item.id)">编辑</button>
		</view>
	</view>
	
</template>

<script>
	let App = getApp(); 
	import Modal from '@/components/x-modal/x-modal'
	export default {
		components: {
			Modal
		},
		data() {
			return {
				// data: {
				// 	phone: '点击登录',
				// 	balance: 0,
				// 	profit: 0,
				// 	total_num: 0,
				// 	silver:0,
				// 	nextLevel:'无',
				// 	self:0,
				// 	euqs:0,
				// 	self_profit:0,
				// 	friend_profit:0,
				//},
				username:'',
				phone:'',
				Searchtext:'',
				uid:'',
				partnerdata:[],
			}
			
		},
		onLoad(option) {
			this.getInfo()
		},
		onShow() {
			this.sys = App.globalData.sys
		},
		
		methods: {
			
			//跳转到伙伴管理
			goupdata(getid){
				uni.navigateTo({
					url:'/pages/my/updatainfo?uid='+getid
				})
			},
			
			//获取伙伴信息
			getInfo(){
				let userinfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:"加载中"
				})
				this.$api.interfaceApi('getpartnerinfo')({
					'uid':userinfo.id
				}).then(res=>{
					if(res.code == 200){
						this.partnerdata = res.data
						
					}
					uni.hideLoading()
				})
			},
			
		},
	}
</script>

<style>
</style>